import { onMounted, onUnmounted } from 'vue'

export default function useEventListener(event = 'click', response: (e: Event) => void) {
  onMounted(() => {
    window.addEventListener(event, response, true)
  })

  onUnmounted(() => {
    window.removeEventListener(event, response, true)
  })

  return {}
}
